package demo.java8.SumTest;

/**
 * Created by Administrator on 2017/5/8.
 */
public class MyThread extends Thread {
    int i;
    long[] sumNum;
    int[] valueNum;
    int temp;
    int max;
    /**
     * Don't let anyone else instantiate this class
     */
    public MyThread(long[] sumNum,int[] valueNum,int i) {
        temp = i*10000;
        max = temp+10000;
        this.sumNum = sumNum;
        this.valueNum = valueNum;
        this.i = i;
    }

    @Override
    public void run() {
        for (int j = temp; j < max; j++) {
            sumNum[i]+= valueNum[j];
        }
    }
}
